package org.leaf.green.b2b

import org.leaf.green.admin.RecordType

class Dealer {

    RecordType recordType
    String serialNumber
    String name
    String alias
    String manager
    String phone
    String address
    Boolean active
    Date dateCreated
    Date lastUpdated

    String toString(){
        return "$serialNumber-$alias"
    }

    static constraints = {
        recordType( nullable:false)
        serialNumber(nullable:false, blank:false, unique:true, maxSize :10) 
        name(nullable:false, blank:false, maxSize : 100)
        alias(nullable:true, maxSixe:20)
        manager(nullable:false, blank:false, maxSize : 10)
        phone(nullable:false, blank : false, maxSize : 11)
        address(nullable:false, blank : false, maxSize : 200)
        active(nullable:true)
    }

    static mapping = {
        table 'B2B_DEALER'
    }
}
